<?xml version="1.0" encoding="utf-8"?>
<!--
                                                                                     
 h       t     t                ::       /     /                     t             / 
 h       t     t                ::      //    //                     t            // 
 h     ttttt ttttt ppppp sssss         //    //  y   y       sssss ttttt         //  
 hhhh    t     t   p   p s            //    //   y   y       s       t          //   
 h  hh   t     t   ppppp sssss       //    //    yyyyy       sssss   t         //    
 h   h   t     t   p         s  ::   /     /         y  ..       s   t    ..   /     
 h   h   t     t   p     sssss  ::   /     /     yyyyy  ..   sssss   t    ..   /     
                                                                                     
	<https://y.st./>
	Copyright © 2018 Alex Yst <mailto:copyright@y.st>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <https://www.gnu.org./licenses/>.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="https://y.st./en/weblog/2018/01-January/28.xhtml"/>
		<title>Making do &lt;https://y.st./en/weblog/2018/01-January/28.xhtml&gt;</title>
		<link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png"/>
		<link rel="stylesheet" type="text/css" href="/link/main.css"/>
		<script type="text/javascript" src="/script/javascript.js"/>
		<meta name="viewport" content="width=device-width"/>
	</head>
	<body>
<nav>
	<p>
		<a href="/en/coursework/">Coursework</a> |
		<a href="/en/take-down/">Take-down requests</a> |
		<a href="/en/">Home</a> |
		<a href="/en/a/about.xhtml">About</a> |
		<a href="/en/a/contact.xhtml">Contact</a> |
		<a href="/a/canary.txt">Canary</a> |
		<a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
		<a href="/en/opinion/">Opinions</a> |
		<a href="/en/law/">Law</a> |
		<a href="/en/recipe/">Recipes</a> |
		<a href="/en/a/links.xhtml">Links</a> |
		<a href="/en/weblog/2018/01-January/28.xhtml.asc">{this page}.asc</a>
	</p>
	<hr/>
	<p>
		Weblog index:
		<a href="/en/weblog/memories">Memories</a> |
		<a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
		<a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
		<a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
	</p>
	<hr/>
	<p>
		Jump to entry:
		<a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
		<a rel="prev" href="/en/weblog/2018/01-January/27.xhtml">&lt;Previous</a>
		<a rel="next" href="/en/weblog/2018/01-January/29.xhtml">Next&gt;</a>
		<a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
			</p>
			<hr/>
</nav>
		<header>
			<h1>Making do</h1>
			<p>Day 01058: <time>Sunday, 2018 January 28</time></p>
		</header>
<section id="dreams">
	
	<p>
		I dreamed a coworker of mine was having problems with the printer at work as I was headed home for the day and asked me to figure out the problem.
		The first issue was that it was out of printer paper.
		The next issue was that it was jammed full of miscellaneous paper, including both used printer paper and used notebook paper.
		I went to the head manager to ask where to find more printer paper, but they were busy dealing with a customer, so I went and looked for it myself.
		I searched and searched, but couldn&apos;t find any.
	</p>
</section>
<section id="cleaning">
	<h2>Apartment cleaning</h2>
	<p>
		As previously planned, I finished my sorting today.
		Aside from my current lack of a backup laptop and the fact that my physical files are still in disarray, I&apos;m about as prepared for the coming term as I can be.
	</p>
</section>
<section id="makeshift">
	<h2>Makeshift music player</h2>
	<p>
		With my mobile out of commission, not having an alternate music player has been annoying.
		I can&apos;t afford a new mobile device though, at least not for the time being, and I&apos;m not convinced getting one later will be necessary either.
		Until a device exists in which the hardware plays nicely with free software ... any mobile I get will be severely gimped.
		I&apos;m not sure having one is even worth it.
		I considered getting a dedicated music player, but ever one of them I can find, if they even support Vorbis files at all, has the same fatal flaw: they require use of a <abbr title="File Allocation Table">FAT</abbr> filesystem.
		<abbr title="File Allocation Table">FAT</abbr> filesystems, in addition to their annoying case insensitivity, require me to rename all my music files to avoid using certain characters, such as question marks and colons.
		I name my files based on their album name, album artist name, track number, and track name.
		For example, Josh Woodward&apos;s Sunny Side of the Street album, which has no album artist metadata, has a song called &quot;Are You Having Fun?&quot; as track eleven.
		I&apos;ve predictably named the file <code>[Sunny Side of the Street][]{11}{Are You Having Fun?}.ogg</code>.
		This file won&apos;t transfer to a <abbr title="File Allocation Table">FAT</abbr> filesystem unless I rename it first.
		Marc With a C has several tracks on Right Where I Am with colons in their titles: the entire Bootwater Suite.
		Professor Shyguy&apos;s Unplugged: Please Check Connection and Marc With a C&apos;s Good Clean Fun: Marc With a C Sings The Monkees! albums themselves have colons in the names.
		I think that the exclamation point in that last one might also cause <abbr title="File Allocation Table">FAT</abbr> filesystems to choke.
		These are not uncommon characters, and it&apos;s not unreasonable to expect to be able to use them!
		Marc uses asterisks, again, forbidden by <abbr title="File Allocation Table">FAT</abbr>, to censor some titles as well.
		I had the work of an artist in my library until recently too that used a whole tonne of garbage characters from Unicode in their titles, and some (but not all) also cause <abbr title="File Allocation Table">FAT</abbr> filesystems to throw a fit.
		Anyway, my point is that I can&apos;t go through and look for all the characters <abbr title="File Allocation Table">FAT</abbr> will choke on and replace them with something else.
		It&apos;s not feasible.
	</p>
	<p>
		I came up with the beginnings of a solution last night.
		Well, not a solution, but a bandage with which to cover the problem with.
		The only <strong>*real*</strong> solution is to abandon <abbr title="File Allocation Table">FAT</abbr> filesystems.
		Anyway, the bandage was an idea for a script that would take the names of tracks in my music library, encode every octet as a hexadecimal pair, and copy the file under the new name to a player.
		My no-album track directory would be treated as special: the directory name would be copied as-is instead of encoded, as Replicant treats the directory name of tracks without album names as the name of the album.
		Tracks with no track name would be given special treatment as well: they wouldn&apos;t have their file names changed, as again, Replicant treats the file names as the track names in such cases.
		I imagine other players take a similar approach.
	</p>
	<p>
		It seems though that the Vorbis <abbr title="PHP Extension Community Library">PECL</abbr> module isn&apos;t available in the Debian repositories.
		Sure, I could install it from elsewhere, but for just my own personal use, it seems like overkill.
		I decided to work with the existing file names instead.
		I soon realised I didn&apos;t need the encoding to be reversible though.
		I don&apos;t need to encode anything.
		A simple <strong>*hash*</strong> of the file names is all I need; that&apos;ll prevent overlapping file names on the <abbr title="File Allocation Table">FAT</abbr> side well enough.
		That&apos;s certainly easier to implement than an encoder; the hashing functions are already built into the language.
	</p>
	<p>
		I&apos;m going to be using an old Android as a music play for a while.
		It&apos;s less expensive than a dedicated music player, and has about the same problems as well.
		Android uses an ext4 filesystem or something of that nature for internal storage, but refuses to read ext{anything} filesystems on <abbr title="Secure Digital">SD</abbr> cards.
		This device cannot be trusted (as the source code is unavailable and unauditable), but I think as long as I don&apos;t connect it to the network (keep it in aeroplane mode) and I don&apos;t give it any personal information, it should be fine.
		I&apos;m unsure of the implications of using the device&apos;s camera, so I won&apos;t be using that either, at least for the time being.
		This thing&apos;ll only be used for music playing and setting a timer for my breaks at work.
	</p>
	<p>
		I was in a rush to get this thing set up for work, so the first implementation of my bandage was the one I went with.
		I didn&apos;t even apply the special treatment to that one directory.
		All the file names are scrambled, and it&apos;s nearly impossible to find any particular file you&apos;re looking for.
		The music player application makes sense of it all and displays the correct names (when correct names are available in the metadata), but I anticipate it&apos;ll be a pain to add new music.
		I&apos;ll probably come up with a more-sophisticated script later.
		Likely, it&apos;ll hash the initial names (to avoid overlapping filenames when characters are stripped), strip the characters that <abbr title="File Allocation Table">FAT</abbr> chokes on, then insert the hash between the file extension and the rest of the filename.
	</p>
</section>
		<hr/>
		<p>
			Copyright © 2018 Alex Yst;
			You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
			If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
			My address is in the source comments near the top of this document.
			This license also applies to embedded content such as images.
			For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
		</p>
		<p>
			<abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
			This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2018%2F01-January%2F28.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.2</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2018%2F01-January%2F28.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
		</p>
	</body>
</html>

